<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>表单示例 - 光年(Light Year Admin V4)后台管理系统模板</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="Light Year Admin V4是一个基于Bootstrap v4.4.1的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="http://lyear.itshubao.com/iframe/v4/css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="js/bootstrap-select-1.13.18/bootstrap-select.min.css" rel="stylesheet">
<link href="http://lyear.itshubao.com/iframe/v4/css/style.min.css" rel="stylesheet">
<style>
/*bootstrap-select插件用到的，也可以不用*/
.bootstrap-select.open .dropdown-toggle {
    border-color: #33cabb!important;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6);
}
.bootstrap-select.open .dropdown-menu.open {
    border: 1px solid #ebebeb;
}
/*示例二、三、四、五*/
.p-t-5 {
    padding-top: 5px;
}
.h-28 {
    height: 28px;
}
/*示例三和四*/
.w-120 {
    width: 120px;
    padding-left: 0px;
    padding-right: 15px;
}
.w-120-calc {
    width: -moz-calc(100% - 120px);
    width: -webkit-calc(100% - 120px);
    width: calc(100% - 120px);
    padding-right: 15px;
}
.offset-md-120 {
    margin-left: 120px;
}
.mx-w-800 {
    max-width: 800px;
    margin: 0 auto;
}
/*示例五*/
.input-group-controls {
    height: 36px;
    flex: 1 1 0%;
    border: 1px solid #F2F3F3;
    padding-left: 15px;
}
</style>
<style>

</style>
</head>
  
<body>
<div class="container-fluid">
  
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">表单示例一</div></div>
        <div class="card-body">
          
          <p>如我在页面lyear_pages_add_doc中使用的那样，标题放在最上面是为了响应式的环境下有较好的体验，不至于因为宽度不够导致文字换行</p>
          <form action="#!" method="post" id="example-from-1" class="row">
            <div class="form-group col-md-12">
              <label for="name">输入框</label>
              <input type="text" class="form-control" id="name" name="name" value="" placeholder="输入框" />
            </div>
            <div class="form-group col-md-12">
              <label for="password">密码框</label>
              <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码框" />
              <small class="form-text text-muted">密码是用5-20位字符</small>
            </div>
            <div class="form-group col-md-12">
              <label for="type">(默认)选择框 - chrome更新后默认的黑色边框巨丑</label>
              <select name="type" class="form-control" id="type">
                <option value="1">小说</option>
                <option value="2">古籍</option>
                <option value="3">专辑</option>
                <option value="4">自传</option>
              </select>
            </div>
            <div class="form-group col-md-12">
              <label for="example">(使用插件)选择框</label>
              <div class="form-controls">
                <select class="form-control selectpicker" title="小伙子选择一个吧..." name="example-6" id="example">
                  <option>吊打海内外的编程技术</option>
                  <option>迷倒万千少女的颜值</option>
                  <option>马云大大的财富</option>
                </select>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="idname">开关</label>
              <div class="form-controls">
                <div class="custom-control custom-switch">
                  <input type="checkbox" class="custom-control-input" value="1" id="exampleSwitch1">
                  <label class="custom-control-label" for="exampleSwitch1"></label>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label>复选框</label>
              <div class="form-controls">
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck1">
                  <label class="custom-control-label" for="customCheck1">篮球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck2">
                  <label class="custom-control-label" for="customCheck2">足球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck3">
                  <label class="custom-control-label" for="customCheck3">排球</label>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label>单选框</label>
              <div class="form-controls">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio" id="customRadio1">
                  <label class="custom-control-label" for="customRadio1">羽毛球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio" id="customRadio2">
                  <label class="custom-control-label" for="customRadio2">冰球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio" id="customRadio3">
                  <label class="custom-control-label" for="customRadio3">网球</label>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="desc">文本域</label>
              <textarea name="desc" id="desc" placeholder="请输入内容" class="form-control"></textarea>
            </div>
            <div class="form-group col-md-12 mb-0">
              <button type="submit" class="btn btn-primary">立即提交</button>
              <button type="reset" class="btn btn-default">重 置</button>
            </div>

          </form>
          
        </div>
      </div>
    </div>
    
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">表单示例二</div></div>
        <div class="card-body">
          
          <p>文字和input在同一行，你可以选择响应式的布局，也可以采用固定宽度的方式，<span class="text-danger">需要注意的是，v4中没有form-horizontal，所以在这种布局的时候，需要给form-group新增一个row的class</span>。</p>
          <form action="#!" method="post" id="example-from-1" class="form-horizontal">
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="name">输入框</label>
              <div class="col-md-10">
                <input type="text" class="form-control" id="name" name="name" value="" placeholder="输入框" />
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="password">密码框</label>
              <div class="col-md-8">
                <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码框" />
              </div>
              <div class="col-md-2"><small class="form-text text-muted p-t-5">密码是用5-20位字符</small></div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="type">(默认)选择框</label>
              <div class="col-md-10">
                <select name="type" class="form-control" id="type">
                  <option value="1">小说</option>
                  <option value="2">古籍</option>
                  <option value="3">专辑</option>
                  <option value="4">自传</option>
                </select>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="example">(使用插件)选择框</label>
              <div class="col-md-10">
                <select class="form-control selectpicker" title="小伙子选择一个吧..." name="example-6" id="example">
                  <option>吊打海内外的编程技术</option>
                  <option>迷倒万千少女的颜值</option>
                  <option>马云大大的财富</option>
                </select>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="idname">开关</label>
              <div class="col-md-10 pt-2 h-28">
                <div class="custom-control custom-switch">
                  <input type="checkbox" class="custom-control-input" value="1" id="exampleSwitch2">
                  <label class="custom-control-label" for="exampleSwitch2"></label>
                </div>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label">复选框</label>
              <div class="col-md-10 pt-2 h-28">
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck21">
                  <label class="custom-control-label" for="customCheck21">篮球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck22">
                  <label class="custom-control-label" for="customCheck22">足球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck23">
                  <label class="custom-control-label" for="customCheck23">排球</label>
                </div>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label">单选框</label>
              <div class="col-md-10 pt-2 h-28">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio2" id="customRadio21">
                  <label class="custom-control-label" for="customRadio21">羽毛球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio2" id="customRadio22">
                  <label class="custom-control-label" for="customRadio22">冰球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio2" id="customRadio23">
                  <label class="custom-control-label" for="customRadio23">网球</label>
                </div>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-md-2 col-form-label" for="desc">文本域</label>
              <div class="col-md-10">
                <textarea name="desc" id="desc" placeholder="请输入内容" class="form-control"></textarea>
              </div>
            </div>
            <div class="form-group row">
              <div class="col-md-10 offset-md-2">
                <button type="submit" class="btn btn-primary">立即提交</button>
                <button type="reset" class="btn btn-default">重 置</button>
              </div>
            </div>

          </form>
          
        </div>
      </div>
    </div>
    
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">表单示例三（固定文字位置宽度）</div></div>
        <div class="card-body">
          
          <p>文字处的宽度设置成固定值，这种方式适用于pc端，手机端会导致input太短。</p>
          <form action="#!" method="post" id="example-from-1">
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="name">输入框</label>
              <div class="float-left w-120-calc">
                <input type="text" class="form-control" id="name" name="name" value="" placeholder="输入框" />
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="password">密码框</label>
              <div class="float-left w-120-calc">
                <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码框" />
                <small class="form-text text-muted">密码是用5-20位字符</small>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="type">选择框</label>
              <div class="float-left w-120-calc">
                <select name="type" class="form-control" id="type">
                  <option value="1">小说</option>
                  <option value="2">古籍</option>
                  <option value="3">专辑</option>
                  <option value="4">自传</option>
                </select>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="example">选择框</label>
              <div class="float-left w-120-calc">
                <select class="form-control selectpicker" title="小伙子选择一个吧..." name="example-6" id="example">
                  <option>吊打海内外的编程技术</option>
                  <option>迷倒万千少女的颜值</option>
                  <option>马云大大的财富</option>
                </select>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="idname">开关</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-switch">
                  <input type="checkbox" class="custom-control-input" value="1" id="exampleSwitch3">
                  <label class="custom-control-label" for="exampleSwitch3"></label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5">复选框</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck31">
                  <label class="custom-control-label" for="customCheck31">篮球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck32">
                  <label class="custom-control-label" for="customCheck32">足球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck33">
                  <label class="custom-control-label" for="customCheck33">排球</label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5">单选框</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio3" id="customRadio31">
                  <label class="custom-control-label" for="customRadio31">羽毛球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio3" id="customRadio32">
                  <label class="custom-control-label" for="customRadio32">冰球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio3" id="customRadio33">
                  <label class="custom-control-label" for="customRadio33">网球</label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="desc">文本域</label>
              <div class="float-left w-120-calc">
                <textarea name="desc" id="desc" placeholder="请输入内容" class="form-control"></textarea>
              </div>
            </div>
            <div class="form-group clearfix">
              <div class="float-left w-120-calc offset-md-120">
                <button type="submit" class="btn btn-primary">立即提交</button>
                <button type="reset" class="btn btn-default">重 置</button>
              </div>
            </div>

          </form>
          
        </div>
      </div>
    </div>
    
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">表单示例四（给表单加上最大宽度，使其居中）</div></div>
        <div class="card-body">
          
          <p>新增样式 <code>mx-w-800</code>，指定最大宽度，让表单居中，你也可以自己定义。</p>
          <form action="#!" method="post" id="example-from-1" class="mx-w-800">
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="name">输入框</label>
              <div class="float-left w-120-calc">
                <input type="text" class="form-control" id="name" name="name" value="" placeholder="输入框" />
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="password">密码框</label>
              <div class="float-left w-120-calc">
                <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码框" />
                <small class="help-block p-t-5">密码是用5-20位字符</small>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="type">选择框</label>
              <div class="float-left w-120-calc">
                <select name="type" class="form-control" id="type">
                  <option value="1">小说</option>
                  <option value="2">古籍</option>
                  <option value="3">专辑</option>
                  <option value="4">自传</option>
                </select>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="example">选择框</label>
              <div class="float-left w-120-calc">
                <select class="form-control selectpicker" title="小伙子选择一个吧..." name="example-6" id="example">
                  <option>吊打海内外的编程技术</option>
                  <option>迷倒万千少女的颜值</option>
                  <option>马云大大的财富</option>
                </select>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="idname">开关</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-switch">
                  <input type="checkbox" class="custom-control-input" value="1" id="exampleSwitch4">
                  <label class="custom-control-label" for="exampleSwitch4"></label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5">复选框</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck41">
                  <label class="custom-control-label" for="customCheck41">篮球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck42">
                  <label class="custom-control-label" for="customCheck42">足球</label>
                </div>
                <div class="custom-control custom-checkbox custom-control-inline">
                  <input type="checkbox" class="custom-control-input" id="customCheck43">
                  <label class="custom-control-label" for="customCheck43">排球</label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5">单选框</label>
              <div class="float-left w-120-calc pt-2 h-28">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio4" id="customRadio41">
                  <label class="custom-control-label" for="customRadio41">羽毛球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio4" id="customRadio42">
                  <label class="custom-control-label" for="customRadio42">冰球</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" class="custom-control-input" name="customRadio4" id="customRadio43">
                  <label class="custom-control-label" for="customRadio43">网球</label>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="w-120 float-left col-form-label p-t-5" for="desc">文本域</label>
              <div class="float-left w-120-calc">
                <textarea name="desc" id="desc" placeholder="请输入内容" class="form-control"></textarea>
              </div>
            </div>
            <div class="form-group clearfix">
              <div class="float-left w-120-calc offset-md-120">
                <button type="submit" class="btn btn-primary">立即提交</button>
                <button type="reset" class="btn btn-default">重 置</button>
              </div>
            </div>

          </form>
          
        </div>
      </div>
    </div>
    
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">表单示例五</div></div>
        <div class="card-body">
          
          <p>使用 <code>input-group</code> 布局。</p>
          <p>这种布局也有局限性，右侧高度固定，如果是复选和单选，手机下可能会错位</p>
          <form action="#!" method="post" id="example-from-1" class="row example-form">
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">输入框</span></div>
                <input type="text" class="form-control" id="name" name="name" value="" placeholder="输入框" />
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">密码框</span></div>
                <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码框" />
              </div>
              <small class="help-block m-b-0">密码是用5-20位字符</small>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">选择框</span></div>
                <select name="type" class="form-control" id="type">
                  <option value="1">小说</option>
                  <option value="2">古籍</option>
                  <option value="3">专辑</option>
                  <option value="4">自传</option>
                </select>
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">选择框</span></div>
                <select class="form-control selectpicker" title="小伙子选择一个吧..." name="example-6" id="example">
                  <option>吊打海内外的编程技术</option>
                  <option>迷倒万千少女的颜值</option>
                  <option>马云大大的财富</option>
                </select>
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">开&nbsp;&nbsp;&nbsp;&nbsp;关</span></div>
                <div class="form-controls input-group-controls p-t-5">
                  <div class="custom-control custom-switch">
                    <input type="checkbox" class="custom-control-input" value="1" id="exampleSwitch5">
                    <label class="custom-control-label" for="exampleSwitch5"></label>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">复选框</span></div>
                <div class="form-controls input-group-controls p-t-5">
                  <div class="custom-control custom-checkbox custom-control-inline">
                    <input type="checkbox" class="custom-control-input" id="customCheck51">
                    <label class="custom-control-label" for="customCheck51">篮球</label>
                  </div>
                  <div class="custom-control custom-checkbox custom-control-inline">
                    <input type="checkbox" class="custom-control-input" id="customCheck52">
                    <label class="custom-control-label" for="customCheck52">足球</label>
                  </div>
                  <div class="custom-control custom-checkbox custom-control-inline">
                    <input type="checkbox" class="custom-control-input" id="customCheck53">
                    <label class="custom-control-label" for="customCheck53">排球</label>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">单选框</span></div>
                <div class="form-controls input-group-controls p-t-5">
                  <div class="custom-control custom-radio custom-control-inline">
                    <input type="radio" class="custom-control-input" name="customRadio5" id="customRadio51">
                    <label class="custom-control-label" for="customRadio51">羽毛球</label>
                  </div>
                  <div class="custom-control custom-radio custom-control-inline">
                    <input type="radio" class="custom-control-input" name="customRadio5" id="customRadio52">
                    <label class="custom-control-label" for="customRadio52">冰球</label>
                  </div>
                  <div class="custom-control custom-radio custom-control-inline">
                    <input type="radio" class="custom-control-input" name="customRadio5" id="customRadio53">
                    <label class="custom-control-label" for="customRadi53">网球</label>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <div class="input-group">
                <div class="input-group-prepend"><span class="input-group-text">文本域</span></div>
                <textarea name="desc" id="desc" placeholder="请输入内容" class="form-control"></textarea>
              </div>
            </div>
            <div class="form-group col-md-12 mb-0">
              <button type="submit" class="btn btn-primary">立即提交</button>
              <button type="reset" class="btn btn-default">重 置</button>
            </div>

          </form>
          
        </div>
      </div>
    </div>
    
  </div>
  
</div>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/v4/js/jquery.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/v4/js/popper.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/v4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-select-1.13.18/bootstrap-select.min.js"></script>
<script type="text/javascript" src="js/bootstrap-select-1.13.18/i18n/defaults-zh_CN.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    // 默认
    $('.selectpicker').selectpicker();
});
</script>
</body>
</html>